|
Spaghetti code is a pejorative phrase for source code that has a complex and tangled control structure, especially one using many GOTO statements, exceptions, threads, or other "unstructured" branching constructs. It is named such because program flow is conceptually like a bowl of spaghetti, i.e. twisted and tangled. Spaghetti code can be caused by several factors, such as continuous modifications by several people over a long life cycle. Structured programming greatly decreases the incidence of spaghetti code. == History == It is not clear when the phrase spaghetti code came into common usage; however, several references appeared in 1977 including ''Macaroni is Better Than Spaghetti'' by Steele published in Proceedings of the 1977 symposium on artificial intelligence and programming languages. In the 1978 book ''A primer on disciplined programming using PL/I, PL/CS, and PL/CT'', Richard Conway used the term to describe types of programs that "have the same clean logical structure as a plate of spaghetti", a phrase repeated in the 1979 book ''An Introduction to Programming'' he co-authored with David Gries. In the 1988 paper ''A spiral model of software development and enhancement'', the term is used to describe the older practice of the ''code and fix model'', which lacked planning and eventually led to the development of the waterfall model. In the 1979 book ''Structured programming for the COBOL programmer'', author Paul Noll uses the phrases ''spaghetti code'' and ''rat's nest'' as synonyms to describe poorly structured source code. In a 1980 publication by the United States National Bureau of Standards, the phrase spaghetti program was used to describe older programs having "fragmented and scattered files". The consequences of using goto statements in programs were described in a 1980 paper, which stated that it was perceived to be "evil".In the ''Ada – Europe '93'' conference, Ada was described as forcing the programmer to "produce understandable, instead of spaghetti code", because of its restrictive exception propagation mechanism. In a 1981 computer languages spoof in ''The Michigan Technic'' titled "BASICally speaking...FORTRAN bytes!!", the author described FORTRAN as "proof positive that the cofounders of IBM were Italian, for it consists entirely of spaghetti code". 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Spaghetti code」の詳細全文を読む スポンサード リンク
|